#include "application.h"

Application::Application(QObject *parent) :
	QObject(parent),
	window(new MainWindow()),
	core(new AppCore())
{
	connect(core, SIGNAL(bookmarksGotten(QVector<BookmarkItem*>*)), window, SLOT(showBookmarks(QVector<BookmarkItem*>*)));
	connect(core, SIGNAL(tabCreated(TabItem*)), window, SLOT(createTab(TabItem*)));
	connect(core, SIGNAL(tabGotten(TabItem*)), window, SLOT(showSelectedTab(TabItem*)));
	connect(window, SIGNAL(needCreateTab(TabItem*)), core, SLOT(newTab(TabItem*)));
	connect(window, SIGNAL(needRemoveTab(int)), core, SLOT(deleteTab(int)));
	connect(window, SIGNAL(needTab(uint)), core, SLOT(getTab(uint)));
	connect(window, SIGNAL(needSaveTab(int,BookmarkItem*)), core, SLOT(saveTab(int,BookmarkItem*)));
	core->readBookmarks("/media/Data_/Wicher8000/q5c9h3p0n7/MrGeneroth.dat2");

	window->init();
}
